<!DOCTYPE html>
<html  lang="en" xmlns:th="http://www.thymeleaf.org">
<head>


    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout  - Layui</title>
    <link rel="stylesheet" th:href="@{/libs/layui/css/layui.css}">

    <link th:href="@{/css/page.css}" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">

</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo layui-hide-xs layui-bg-black">校园应用系统</div>

        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                <a href="javascript:;">
                    <img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
                    tester
                </a>
                <dl class="layui-nav-child">
                    <dd><a href="">Your Profile</a></dd>
                    <dd><a href="">Settings</a></dd>
                    <dd><a href="">Sign out</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                <a href="javascript:;">
                    <i class="layui-icon layui-icon-more-vertical"></i>
                </a>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item layui-nav-itemed">
                    <a class="" href="javascript:;">学生管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/findAll">学生基本信息管理</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item">
                    <a href="javascript:;">教室管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/findAllClassroom">教室信息管理</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item">
                    <a href="javascript:;">班级管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/findAllGrade">班级信息管理</a></dd>
                    </dl>
                </li>

                <li class="layui-nav-item">
                    <a href="javascript:;">宿舍管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/findAllDormitory">宿舍信息管理</a></dd>
                    </dl>
                </li>

            </ul>
        </div>
    </div>



    <div class="layui-body">

        <form action="/queryDor" method="post">

            <label style="float: left;margin-left: 10px;padding-top: 10px">宿舍名称:</label>
            <div style="float: left;">
                <input type="text" id="dormitoryName" name="dormitoryName" lay-verify="identity" placeholder="请输入宿舍名称" autocomplete="off" class="layui-input">
            </div>

            <div style="float: left;margin-left: 10px;">
                <label style="float: left;padding-top: 10px">区域:</label>
                <select name="area" style="margin-top: 10px" lay-filter="area">
                    <option value="">请选择</option>
                    <option value="A">A区</option>
                    <option value="B">B区</option>
                    <option value="C">C区</option>
                    <option value="D">D区</option>
                </select>
            </div>

            <div style="float: left;margin-left: 10px;">
                <label style="float: left;padding-top: 10px">楼号:</label>
                <select name="buildingNo" style="margin-top: 10px" lay-filter="buildingNo">
                    <option value="">请选择</option>
                    <option value="1">1楼</option>
                    <option value="2">2楼</option>
                    <option value="3">3楼</option>
                </select>
            </div>

            <div style="float: left;margin-left: 10px;">
                <label style="float: left;padding-top: 10px">楼层:</label>
                <select name="buildingFloor"  style="margin-top: 10px" lay-filter="buildingFloor">
                    <option value="">请选择</option>
                    <option value="1">1层</option>
                    <option value="2">2层</option>
                    <option value="3">3层</option>
                </select>
            </div>

        <input type="submit" value="查询" class="layui-btn layui-btn-normal ">

        </form>




    <table class="table">
      <tr>
        <th>主键ID</th>
        <th>区域</th>
        <th>楼号</th>
        <th>楼层</th>
        <th>宿舍ID</th>
        <th>宿舍名称</th>
        <th>床位数量</th>
        <th>教室是否被使用</th>
        <th>创建时间</th>
        <th>修改时间</th>
          <th>操作</th>
      </tr>

      <tr th:each="list:${p.list}"  class="active">
          <td th:text="${list.pkId}"></td>
          <td th:text="${list.area}"></td>
          <td th:text="${list.buildingNo}"></td>
          <td th:text="${list.buildingFloor}"></td>
          <td th:text="${list.dormitoryId}"></td>
          <td th:text="${list.dormitoryName}"></td>
          <td th:text="${list.bedNumber}"></td>
          <td th:switch="${list.useStatus}">
              <span th:case="0">正常</span>
              <span th:case="1">空闲</span>
              <span th:case="2">停用</span>
              <span th:case="3">保留</span>
          </td>
          <td th:text="${#dates.format(list.createTime,'yyyy-MM-dd')}"></td>
          <td th:text="${#dates.format(list.updateTime,'yyyy-MM-dd')}"></td>

          <td>
              <a th:href="@{/deleteDor(pkId=${list.pkId})}" class="layui-btn layui-btn-danger"><i class="layui-icon"></i>删除</a>
              <a th:href="@{/updateByIdDor(pkId=${list.pkId})}"  class="layui-btn layui-btn-normal " ><i class="layui-icon"></i>修改</a>
          </td>
      </tr>

    </table>



    <div class="left">
        <form action="/findAllDormitory" style="text-align: center;" method="post" >
            <ul class="pagination">
                <li ><a  href="/findAllDormitory?pageNum=1">首页</a></li>
                <span th:if="${p.pageNum>1}"><li><a th:href="@{/findAllDormitory(pageNum=${p.pageNum}-1)}">上一页</a></li></span>

                <span  test="${p.pageNum<p.pages}">
                    <li ><a href="/findAllDormitory?pageNum=2">下一页</a></li>
                </span>

                <li ><a th:href="@{/findAllDormitory(pageNum=${p.pages})}">末页</a></li>
                <li><a  th:text="${p.pages}"></a></li>
                <li><a >跳到<input type="text" name="pageNum" style="width: 20px; height: 20px">页</a></li>
                <li><a><input type="submit" value="GO" /></a></li>
            </ul>
        </form>
    </div>

    </div>




    <div class="layui-footer">

    </div>

</div>
<script th:src="@{/libs/layui/layui.js}"></script>




</body>
</html>